package com.xiaoyang.lotterysystem.dao.mapper;

import com.xiaoyang.lotterysystem.dao.dataobject.ActivityUserDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ActivityUserMapper {


    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
    int batchInsert(@Param("items") List<ActivityUserDO> activityPrizeDos);

    @Select("select * from activity_user where activity_id = #{activityId}")
    List<ActivityUserDO> selectByActivityId(@Param("activityId") Long activityId);


    List<ActivityUserDO> batchSelectByAUIds(@Param("activityId") Long activityId,
                                            @Param("userIds") List<Long> userIds);

    void batchUpdateStatus(@Param("activityId") Long activityId,
                           @Param("userIds") List<Long> userIds,
                           @Param("status") String status);
}
